<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ include file="/WEB-INF/views/include/constrant.jsp"%>
<html>
<head>
	<title>订单信息</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			// 正整数
			$.validator.addMethod("positive", function(value, element) {
				if(value<=0){
					return false;
				}else {
					return true;
				}
			}, "不能为0");
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/rentproduct/list">整车预定</a></li>
		<li class="active"><a href="${ctx}/rentproduct/details?time=${time }&days=${days }&rentid=${tRentproduct.rentid}">订单信息</a></li>
	</ul>
	<form id="inputForm" action="${ctx}/rentproduct/booking" method="post" class="form-horizontal">
		<input type="hidden" name="bookingdays" value="${days }" />
		<input type="hidden" name="time" value="${time }" />
		<input type="hidden" name="realscheid" value="${tRentproduct.rentid }" />
		<input type="hidden" name="departdate" value="<fmt:formatDate value="${tRentproduct.fromdate}"  pattern="yyyy-MM-dd HH:mm:ss" />" />
		<sys:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">出发时间：</label>
			<div class="controls">
				<fmt:formatDate value="${tRentproduct.fromdate}" type="both" dateStyle="full" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">车型名称：</label>
			<div class="controls">
				${tRentproduct.cargotype.typename}
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">预定车辆数：</label>
			<div class="controls">
				<input type="text" name="purchasenum" value="1" class="input-mini required digits positive" />
				<span class="help-inline">辆<font color="red">*</font></span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">出发/目的城市：</label>
			<div class="controls">
				${tRentproduct.departcity.name} － ${not empty tRentproduct.destcity and not empty tRentproduct.destcity.id?tRentproduct.destcity.name:"无"}
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">上车地点：</label>
			<div class="controls">
				<input type="text" name="boardaddr" value="" class="input-large required" maxlength="200"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">下车地点：</label>
			<div class="controls">
				<input type="text" name="offaddr" value="" class="input-large" maxlength="200"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系人：</label>
			<div class="controls">
				<input type="text" name="contacts" value="" class="input-medium required" maxlength="50"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系电话：</label>
			<div class="controls">
				<input type="text" name="payertel" value="" class="input-medium required phone"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">行程备注：</label>
			<div class="controls">
				<textarea rows="5" name="remarks" class="input-large"  maxlength="500"></textarea>
			</div>
		</div>
		<c:if test="${not empty tRentproduct.destcity and not empty tRentproduct.destcity.id }">
			<div class="control-group">
				<label class="control-label">订单类型：</label>
				<div class="controls">
					<select name="bookingtype" class="input-mini required">
						<option value="${TORDERS_BOOKING_TYPE_ONE }">往返</option>
						<option value="${TORDERS_BOOKING_TYPE_TWO }">单程</option>
					</select>
				</div>
			</div>
		</c:if>
		<!-- <div class="control-group">
			<label class="control-label">订单金额：</label>
			<div class="controls">
				<span id="shoMoney"></span>
			</div>
		</div> -->
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form>
</body>
</html>